#define _CRT_SECURE_NO_WARNINGS 1
#include<cstdio>
#include<iostream>
#include<cmath>

using namespace std;

int arr[100][100];

int main()
{
    int x;
    while (cin >> x, x != 0)
    {
        for (int i = 0; i < x; i++)
        {
            for (int j = 0; j < x; j++)
            {
                cout << (int)pow(2, i + j) << ' ';
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}
